package com.wintop.youyuan.services.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wintop.youyuan.dao.MailBoxDao;
import com.wintop.youyuan.model.Inform;
import com.wintop.youyuan.model.Luck;
import com.wintop.youyuan.model.Message;
import com.wintop.youyuan.services.MailBoxServices;

@Service("mailBoxServices")
public class MailBoxServicesImpl implements MailBoxServices {
	private MailBoxDao mailBoxDao;

	@Resource(name = "mailBoxDao")
	public void setMailBoxDao(MailBoxDao mailBoxDao) {
		this.mailBoxDao = mailBoxDao;
	}

	@Override
	public boolean addMailInformation(Object object) {
		return mailBoxDao.addMailInformation(object);
	}

	@Override
	public boolean deleteMailInformation(Object object) {
		return mailBoxDao.deleteMailInformation(object);
	}

	@Override
	public List<Luck> getLucks(String userid, String property) {
		return mailBoxDao.getLucks(userid, property);
	}

	@Override
	public List<Message> getMessages(String userid) {
		return mailBoxDao.getMessages(userid);
	}

	@Override
	public List<Message> getMessages(String userid, String sendId) {
		return mailBoxDao.getMessages(userid, sendId);
	}

	@Override
	public List<Inform> getInforms(String userid) {
		return mailBoxDao.getInforms(userid);
	}

	@Override
	public int getMessageNum(String userid) {
		return mailBoxDao.getMessageNum(userid);
	}

	@Override
	public int getInformNum(String userid) {
		return mailBoxDao.getInformNum(userid);
	}

	@Override
	public boolean readMessage(String userid, String sendId) {
		return mailBoxDao.readMessage(userid, sendId);
	}

	@Override
	public boolean deleteMessages(String userid, String sendId) {
		return mailBoxDao.deleteMessages(userid, sendId);
	}

	@Override
	public List<Message> getRecentMessages(String userid) {
		return mailBoxDao.getRecentMessages(userid);
	}

	@Override
	public boolean getAttention(String userid, String sendId) {
		return mailBoxDao.getAttention(userid, sendId) != null;
	}
}
